package com.gukewen.alibabacloudoss.controller;

import com.gukewen.alibabacloudoss.utils.AliOSSUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private AliOSSUtils aliOSSUtils;

    @PostMapping("/test")
    public String test(MultipartFile image) throws Exception
    {
            String url = aliOSSUtils.upload(image);
            return url;

    }
}
